<?php
/**
 * Formul�rio de remo��o de uma Categoria de Materiais.
*/

if(!isset($_SESSION))
{
   session_start();
}

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( 0, 4 ) );

$categoria = new Categoria();
$categoriasCadastradas = $categoria->CarregarCategorias();
?>
<html>
           <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
           <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
           <head>
           <title>SAEO - Remo��o de Categoria</title>
           <script type='text/javascript' src='templates/hintbox.js'></script>
           <script type='text/javascript' src='templates/js.js'></script>
           <script type='text/javascript' src='templates/fornecedor.js'></script>
           <script type='text/javascript' src='templates/ajax.js'></script>
           <link rel='stylesheet' type='text/css' href='templates/estilos.css'/>

           </head>
     <body class='body'>
     <form name='remover_categoria' action='EnviarDadosCategoria.php?operacao=3' method='post'>
     <table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
            <tr>
                <td>
                	<?php include "Topo.php"; ?>
				</td>
            </tr>
            <tr>
                <td><div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>REMO��O DE CATEGORIAS</div></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td><table class='tabela' width='650' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Categoria: </td>
                               <td class='textoTabelas'>
                               <select name='categoriaId' id='listaCategorias' class='inputTexto' onchange='MostrarDiv(this.value,document.getElementById("informacaoCategoria"));'>
                                       <option id='categoria' value='0'>Selecione a categoria</option>
                                       <?php 
                                       for( $i = 0; $i < count($categoriasCadastradas); $i++ )
                                       {
                                       ?>
                                            <option id='<?php echo $categoriasCadastradas[$i]->id ?>' value='<?php echo $categoriasCadastradas[$i]->id; ?>'><?php echo $categoriasCadastradas[$i]->nome; ?></option>
                                       <?php 
                                       }
									   ?>
                               </select>
                               <a href='#' class='hintanchor' onMouseover='showhint("Escolha a Categoria que deseja remover.", this, event, "220px");'>[?]</a>
                               </td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                            <tr>
                               <td colspan='2'>
                                   <div id='informacaoCategoria' style='display: none'>
                                        <table width='650' class='tabela' style='border-style: none' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFE3'>
                                            <tr>
                                               <td colspan='2' height='46'><div style='position:relative;left:540px'><input type='image' style='width:100px;height:30px;' src='templates/btremover.JPG'/></div></td>
                                            </tr>
                                        </table>
                                   </div>
                               </td>
                           </tr>
                     </table>
                </td>
            </tr>
            <tfoot>
           <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
                   <tr>
                       <?php include 'rodapeCreditos.php'; ?>
            </tr>
            </tfoot>
     </table>
     </form>
     </body>
     </html>